package com.yc.bank.mapper;

import com.yc.bank.entity.Oprecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.jdbc.core.BeanPropertyRowMapper;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 银行-操作流水表-2 Mapper 接口
 * </p>
 *
 * @author lyx
 * @since 2023-06-01
 */
public interface OprecordMapper extends BaseMapper<Oprecord> {

    @Select("select * from bank_oprecord a join bank_account b" +
            " on a.aid = b.id")
    public List<Map> selectAll();

    //订单创建
    @Insert("insert into bank_oprecord values " +
            " (default,#{aid},#{opmoney},#{charge},now(),#{remark})")
    public int insert(Oprecord oprecord);

    //订单查询
    @Select("select * from bank_oprecord where aid = #{aid}")
    public List<Oprecord> selectByAid(String aid);
}
